/**
 *    @file       csha.h
 *
 *    @brief      
 *    @details
 *
 *    @version    1.0
 *    @date       01/22/2014 11:28:56 PM
 *
 *    @author     Theophilus (), wangtf418@gmail.com
 */
#ifndef _BF_CSHA_H_
#define _BF_CSHA_H_
#include <openssl/sha.h>
#include "comdef.h"

/// class csha
class csha
{
public:
	csha();
	~csha();

public:
	bf_int_t update(const bf_uchar_t *data, bf_size_t len);
	bf_int_t finish(bf_uchar_t hash[20]);

private:
	bf_int_t m_initflag;
	SHA_CTX m_sha_ctx;
};

/// class csha1
class csha1
{
public:
	csha1();
	~csha1();

public:
	bf_int_t update(const bf_uchar_t *data, bf_size_t len);
	bf_int_t finish(bf_uchar_t hash[20]);

private:
	bf_int_t m_initflag;
	SHA_CTX m_sha_ctx;
};

#endif

